package org.zachary.creditbusiness.hotel.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.zachary.creditbusiness.hotel.service.OccupancyService;

import java.util.Map;

@RestController
@RequestMapping("/hotels")
public class HotelPredictController {

    @Autowired
    private OccupancyService occupancyService;

    /**
     * 新增端点：GET /hotels/predict?hotelId=123
     */
    @GetMapping("/predict")
    public Map<String, Double> predict(@RequestParam("hotelId") Integer hotelId) {
        return occupancyService.predict(hotelId);
    }
}